n =int(input("输入菜的总个数："))
diet = []
count = 0
for j in range(n):
    name =input("输入第{}菜名：".format(j+1))
    diet.append(name)
for a in range(n):
    for b in range(0,a+1):
        if not (a==b):
            map = [diet[a], diet[b]]
            count += 1
            print(map, end="  ")
    print()
print("共有{}种组合方式组合这{}种菜。".format(count,n))

